package com.pkk.penguin.frame.know.java.driven.profile.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @author peikunkun
 * @version V1.0
 * @date 2020-10-13 17:09
 **/

@Data
@Configuration
@NoArgsConstructor
@AllArgsConstructor
public class ProfileBean {

  private String info;


  @Bean
  @Profile("dev")
  public String dev() {
    System.out.println("触发dev");
    return "dev";
  }


  @Bean
  @Profile("prod")
  public String prod() {
    System.out.println("触发prod");
    return "prod";
  }

}
